source PAC.tcl

# DemoA --
#

inherit DemoA Abstraction
method DemoA constructor {control} {
   this inherited $control 
   
   
}

method DemoA destructor {} {
   this inherited
}



# DemoP --


inherit DemoP Presentation
method DemoP constructor {control} {
	this inherited $control
	
	set this(window) [toplevel ._${className}] 
   wm title $this(window) "Demo"
   #wm protocol $this(window) WM_DELETE_WINDOW "$this(control) dispose"
   
   set this(canvas) [canvas $this(window).canvas -width 100 -height 100]
   pack $this(canvas) -expand 1 -fill both
	
}

method DemoP getCanvas {} {
	return $this(canvas)
}

method DemoP destructor {} {
   this inherited
}


# Demo --


inherit Demo Control
method Demo constructor {} {
   DemoA ${objName}_abst $objName
   DemoP ${objName}_pres $objName
   this inherited "" ${objName}_abst ${objName}_pres
   
   set this(demondraw) [DemoDraw d]
   $this(demondraw) draw [$this(presentation) getCanvas]
}

method Demo destructor {} {
   this inherited
}

#*********************************************************
#*********************************************************
#*********************************************************
#*********************************************************

inherit DemoDrawP Presentation
method DemoDrawP constructor {control} {
	this inherited $control
	
	 
}



method DemoDrawP show {canvas} { 
	set this(canvas) $canvas
	$this(canvas) create oval 10 10 80 70 -outline #777
	$this(canvas) create line 10 10 80 70 -width 10
}

method DemoDrawP destructor {} {
   destroy $this(window)
}


# Demo --


inherit DemoDraw Control
method DemoDraw constructor {} {
   DemoDrawP ${objName}_pres $objName
   this inherited "" "" ${objName}_pres
   
   
}

method DemoDraw draw {canvas} {
	$this(presentation) show $canvas
}

method DemoDraw destructor {} {
   this inherited
}

